package my.jpcap;

import jpcap.JpcapCaptor;

/**
 * 统计某一个网卡上流线的线程
 * 
 * @author www.NetJava.cn
 */
class LoopPacketThread extends Thread {
	private JpcapCaptor jpcap;
	private String ipAdd;
	private boolean continueLoop = true;

	/**
	 * 构造器
	 * 
	 * @param jpcap
	 *            :cap对象
	 * @param ipAdd
	 *            :网络地址名字
	 */
	public LoopPacketThread(JpcapCaptor jpcap, String ipAdd) {
		this.jpcap = jpcap;
		this.ipAdd = ipAdd;
	}

	public void run() {
		while (continueLoop) {
			this.jpcap.loopPacket(1, new DumpPacket(this.ipAdd));
		}
	}

	public void setContinueLoop(boolean continueLoop) {
		this.continueLoop = continueLoop;
	}
}
